@page "/Basic_StepLine_Chart"
@inject NavigationManager NavigationManager
@inject HttpClient HttpClient

<Line @ref="@chart1" Config="config1" Data="data1" />

<Divider>动手实验</Divider>
<DynamicExample @ref="@example">
    <Line @ref="@chart" />
</DynamicExample>

@code{

    public IChartComponent chart;
    DynamicExample example;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        example.Chart = chart;
    }

    IChartComponent chart1;
    FireworksSalesItem[] data1;

    protected override async Task OnInitializedAsync()
    {
        data1 = await DemoData.FireworksSalesAsync(NavigationManager, HttpClient);
        await chart1.ChangeData(data1);

        await base.OnInitializedAsync();
    }


    #region 示例1

    LineConfig config1 = new LineConfig()
    {
        StepType = LineConfig.StepTypeHV,
        Padding = "auto",
        XField = "Date",
        YField = "scales",

    };

    #endregion 示例1


}

